<?php

namespace Biz;

use Aliyun\Ecs\Request\V20140526 as Ecs;
use vod\Request\V20170321\CreateUploadVideoRequest;


class AliyunVod
{
    private $vhost;
    private $appName;
    private $privateKey;
    private $accessKey;
    private $accessSecret;

    public function __construct($config)
    {
        $this->vhost = $config['host'];
        $this->appName = $config['app_name'];
        $this->accessKey = $config['access_key'];
        $this->accessSecret = $config['access_secret'];
        $this->privateKey = $config['private_key'];
    }

    public function createUploadVideo()
    {
        vendor('aliyun-openapi-php-sdk/aliyun-php-sdk-core/Config');
        \Autoloader::addAutoloadPath('aliyun-php-sdk-vod');
        $iClientProfile = \DefaultProfile::getProfile('cn-shanghai', $this->accessKey, $this->accessSecret);
        $client = new \DefaultAcsClient($iClientProfile);
        $request = new CreateUploadVideoRequest();
        $request->setTitle('测试视频');
        $request->setFileName('my.mp4');
        $response = $client->getAcsResponse($request);
        return $response;



    }

        
}
